# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=lunar
pkgver=968.62c8554
pkgrel=1
pkgdesc='A UNIX security auditing tool based on several security frameworks.'
groups=('blackarch' 'blackarch-scanner' 'blackarch-defensive')
arch=('any')
url='https://github.com/lateralblast/lunar'
license=('custom:unknown')
depends=('bash' 'netkit-bsd-finger' 'bc')
makedepends=('git')
source=("git+https://github.com/lateralblast/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md changelog

  rm README.md changelog

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec bash $pkgname.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

